Quarto with Reveal.js

Brief Introduction

Matt Braaksma

University of Minnesota

April 30, 2024

What is Quarto?

Quarto vs xaringan

  • What is the difference?
    • Quarto uses reveal.js to generate html slides
    • xaringan uses remark.js to generate html slides
  • Quarto has most of the features of xaringan, but more flexibility and more current development
    • Integration with VS Code (visual editor, preview, etc.)
    • Output options include html, beamer (LaTeX/PDF), pptx

Slide Formatting

---
title: "Habits"
author: "John Doe"
format: revealjs
---

# In the morning

## Getting up

- Turn off alarm
- Get out of bed

## Breakfast

- Eat eggs
- Drink coffee

# In the evening

## Dinner

- Eat spaghetti
- Drink wine

## Going to sleep

- Get in bed
- Count sheep

Header for these Slides

---
title: 'Quarto with Reveal.js'
subtitle: 'Brief Introduction'
format: 
  clean-revealjs:
    embed-resources: true
    incremental: true
    html-math-method: katex
    scrollable: true
    code-overflow: wrap
    title-slide-attributes: 
      data-background-image: UMN9_M-1line-blk.png
      data-background-size: 25%
      data-background-position: 4% 97%
  beamer: default
  pptx: default
author:
  - name: Matt Braaksma
    email: braak014@umn.edu
    affiliations: University of Minnesota
date: April 30, 2024
---

Executable Code

# Import data with R
library(tigris)
library(ggplot2)
mn_counties <- counties("MN")
mn_roads <- primary_secondary_roads("MN")
# Import data with Python
import pygris

counties = pygris.counties(state = "MN", cb = True, cache = True)
roads = pygris.primary_secondary_roads(state = "MN", cache = True)

Figures

Code
ggplot(mn_counties) + 
  geom_sf() + 
  theme_void()

Code
ggplot(mn_roads) + 
  geom_sf() + 
  theme_void()

Python Code

Code
counties.explore()
Make this Notebook Trusted to load map: File -> Trust Notebook
Code
roads.explore()
Make this Notebook Trusted to load map: File -> Trust Notebook

Write Equations with LaTeX

The Wald estimator:

\hat{\delta}_{IV,wald} \equiv \frac{E_N [y_i | z_i =1] - E_N [y_i | z_i =0]}{E_N [d_i | z_i =1] - E_N [d_i | z_i =0]}

Extensions: roughnotation

Use the .rn to class to specify what elements should be highlighted.

Underline

Box

Circle

Highlight

Strike-Through

Crossed-off

Render to other formats

quarto render apec_seminar_quarto.qmd --to beamer
quarto render apec_seminar_quarto.qmd --to pptx

Resources for Learning More